program delphiproj;

{$APPTYPE CONSOLE}

uses
  SysUtils, windows;

type
  senddatafunc = procedure(peerid: pchar; data: pchar; size: Integer);

//  struct p2pserver_interface {
//    void (*senddatafunc) (char *peerid, char *data, int size);
//};
  p2pserver_interface= packed record
    senddata: senddatafunc;
  end;

  TInitProc= procedure(p2pserver: p2pserver_interface);

var
  dllhandle: HMODULE;
  iinit: TInitProc = Nil;
  gp2pserver: p2pserver_interface;
begin

  try
    { TODO -oUser -cConsole Main : Insert code here }
    dllhandle := LoadLibrary('storeserver.dll');
    @iinit := GetProcAddress(dllhandle, 'initexif');
    if Assigned(iinit) then
    begin
      iinit(gp2pserver);
    end;
    
  except
    on E:Exception do
      Writeln(E.Classname, ': ', E.Message);
  end;
end.
